const { Command } = require("commander");

const readline = require("readline-sync");

const program = new Command();

function getUser() {
  // 提示用户输入内容
  console.log("请输入用户名：");
  let username = readline.question(); // 等待用户输入
  console.log("请输入密码：");
  let password = readline.question(); // 等待用户输入
  // 将用户输入的内容打印到控制台上
  console.log(username);
  console.log(password);
  console.log(__dirname);
}

program.name("readline").description("CLI to readline").version("1.8.0");

program.command("login").action(() => {
  getUser();
});

program.parse();
